package com.saturn.action.sldb.discussion;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.saturn.app.utils.BeanUtils;
import com.saturn.app.web.IAction;
import com.saturn.app.web.IView;
import com.saturn.app.web.view.JsonView;
import com.saturn.sldb.Emergency;

public class CheckSafeWayAction implements IAction{
	@Override
	public IView execute(HttpServletRequest request,
			HttpServletResponse response) {
		Emergency vo = BeanUtils.getBean(request, Emergency.class);
		int count = vo.checkSafeWay(vo.getIdentify());
		/*try {
			response.getWriter().write(count);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		return new JsonView("{\"count\":"+count+"}");
	}
	@Override
	public String requestMapping() {
		return "/app/sldb/emergency/apply/checkSafeWayAction.action";
	}
}
